.class public Lcom/jecelyin/editor/v2/adapter/TabAdapter;
.super Landroidx/recyclerview/widget/RecyclerView$Adapter;
.source "TabAdapter.java"


# annotations
.annotation system Ldalvik/annotation/MemberClasses;
    value = {
        Lcom/jecelyin/editor/v2/adapter/TabAdapter$a;
    }
.end annotation


# instance fields
.field private a:Landroid/content/Context;

.field private b:[Lcom/jecelyin/editor/v2/common/e;

.field private c:Landroid/view/View$OnClickListener;

.field private d:I

.field private e:[I


# direct methods
.method public constructor <init>(Landroid/content/Context;)V
    .locals 1

    .line 1
    invoke-direct {p0}, Landroidx/recyclerview/widget/RecyclerView$Adapter;-><init>()V

    const/4 v0, 0x0

    .line 2
    iput v0, p0, Lcom/jecelyin/editor/v2/adapter/TabAdapter;->d:I

    .line 3
    iput-object p1, p0, Lcom/jecelyin/editor/v2/adapter/TabAdapter;->a:Landroid/content/Context;

    .line 4
    invoke-direct {p0, p1}, Lcom/jecelyin/editor/v2/adapter/TabAdapter;->a(Landroid/content/Context;)V

    return-void
.end method

.method static synthetic a(Lcom/jecelyin/editor/v2/adapter/TabAdapter;)Landroid/content/Context;
    .locals 0

    .line 1
    iget-object p0, p0, Lcom/jecelyin/editor/v2/adapter/TabAdapter;->a:Landroid/content/Context;

    return-object p0
.end method

.method private a(Landroid/content/Context;)V
    .locals 3

    const/4 v0, 0x2

    new-array v0, v0, [I

    .line 4
    sget v1, Lcom/jecelyin/editor/v2/f;->Alpha60TextColor:I

    const/4 v2, 0x0

    aput v1, v0, v2

    sget v1, Lcom/jecelyin/editor/v2/f;->TabItemSelectedColor:I

    const/4 v2, 0x1

    aput v1, v0, v2

    .line 5
    invoke-static {p1, v0}, Lcom/jecelyin/editor/v2/utils/i;->a(Landroid/content/Context;[I)[I

    move-result-object p1

    iput-object p1, p0, Lcom/jecelyin/editor/v2/adapter/TabAdapter;->e:[I

    return-void
.end method

.method static synthetic b(Lcom/jecelyin/editor/v2/adapter/TabAdapter;)[I
    .locals 0

    .line 1
    iget-object p0, p0, Lcom/jecelyin/editor/v2/adapter/TabAdapter;->e:[I

    return-object p0
.end method


# virtual methods
.method public a(Landroid/view/View$OnClickListener;)V
    .locals 0

    .line 3
    iput-object p1, p0, Lcom/jecelyin/editor/v2/adapter/TabAdapter;->c:Landroid/view/View$OnClickListener;

    return-void
.end method

.method public a([Lcom/jecelyin/editor/v2/common/e;)V
    .locals 0

    .line 2
    iput-object p1, p0, Lcom/jecelyin/editor/v2/adapter/TabAdapter;->b:[Lcom/jecelyin/editor/v2/common/e;

    return-void
.end method

.method public d(I)V
    .locals 0

    .line 1
    iput p1, p0, Lcom/jecelyin/editor/v2/adapter/TabAdapter;->d:I

    .line 2
    invoke-virtual {p0}, Landroidx/recyclerview/widget/RecyclerView$Adapter;->notifyDataSetChanged()V

    return-void
.end method

.method public getItem(I)Lcom/jecelyin/editor/v2/common/e;
    .locals 1

    .line 1
    iget-object v0, p0, Lcom/jecelyin/editor/v2/adapter/TabAdapter;->b:[Lcom/jecelyin/editor/v2/common/e;

    aget-object p1, v0, p1

    return-object p1
.end method

.method public getItemCount()I
    .locals 1

    .line 1
    iget-object v0, p0, Lcom/jecelyin/editor/v2/adapter/TabAdapter;->b:[Lcom/jecelyin/editor/v2/common/e;

    if-nez v0, :cond_0

    const/4 v0, 0x0

    return v0

    .line 2
    :cond_0
    array-length v0, v0

    return v0
.end method

.method public onBindViewHolder(Landroidx/recyclerview/widget/RecyclerView$ViewHolder;I)V
    .locals 5

    .line 1
    check-cast p1, Lcom/jecelyin/editor/v2/adapter/TabAdapter$a;

    .line 2
    invoke-virtual {p0, p2}, Lcom/jecelyin/editor/v2/adapter/TabAdapter;->getItem(I)Lcom/jecelyin/editor/v2/common/e;

    move-result-object v0

    .line 3
    iget v1, p0, Lcom/jecelyin/editor/v2/adapter/TabAdapter;->d:I

    const/4 v2, 0x0

    if-ne p2, v1, :cond_0

    .line 4
    iget-object v1, p1, Landroidx/recyclerview/widget/RecyclerView$ViewHolder;->itemView:Landroid/view/View;

    const/4 v3, 0x1

    invoke-virtual {v1, v3}, Landroid/view/View;->setSelected(Z)V

    .line 5
    iget-object v1, p1, Lcom/jecelyin/editor/v2/adapter/TabAdapter$a;->d:Landroid/view/View;

    invoke-virtual {v1, v2}, Landroid/view/View;->setVisibility(I)V

    .line 6
    iget-object v1, p1, Lcom/jecelyin/editor/v2/adapter/TabAdapter$a;->a:Landroid/widget/TextView;

    iget-object v4, p0, Lcom/jecelyin/editor/v2/adapter/TabAdapter;->e:[I

    aget v4, v4, v3

    invoke-virtual {v1, v4}, Landroid/widget/TextView;->setTextColor(I)V

    .line 7
    iget-object v1, p1, Lcom/jecelyin/editor/v2/adapter/TabAdapter$a;->b:Landroid/widget/TextView;

    iget-object v4, p0, Lcom/jecelyin/editor/v2/adapter/TabAdapter;->e:[I

    aget v3, v4, v3

    invoke-virtual {v1, v3}, Landroid/widget/TextView;->setTextColor(I)V

    goto :goto_0

    .line 8
    :cond_0
    iget-object v1, p1, Lcom/jecelyin/editor/v2/adapter/TabAdapter$a;->d:Landroid/view/View;

    const/4 v3, 0x4

    invoke-virtual {v1, v3}, Landroid/view/View;->setVisibility(I)V

    .line 9
    iget-object v1, p1, Landroidx/recyclerview/widget/RecyclerView$ViewHolder;->itemView:Landroid/view/View;

    invoke-virtual {v1, v2}, Landroid/view/View;->setSelected(Z)V

    .line 10
    iget-object v1, p1, Lcom/jecelyin/editor/v2/adapter/TabAdapter$a;->a:Landroid/widget/TextView;

    iget-object v3, p0, Lcom/jecelyin/editor/v2/adapter/TabAdapter;->e:[I

    aget v3, v3, v2

    invoke-virtual {v1, v3}, Landroid/widget/TextView;->setTextColor(I)V

    .line 11
    iget-object v1, p1, Lcom/jecelyin/editor/v2/adapter/TabAdapter$a;->b:Landroid/widget/TextView;

    iget-object v3, p0, Lcom/jecelyin/editor/v2/adapter/TabAdapter;->e:[I

    aget v3, v3, v2

    invoke-virtual {v1, v3}, Landroid/widget/TextView;->setTextColor(I)V

    .line 12
    :goto_0
    iget-object v1, p1, Lcom/jecelyin/editor/v2/adapter/TabAdapter$a;->a:Landroid/widget/TextView;

    new-instance v3, Ljava/lang/StringBuilder;

    invoke-direct {v3}, Ljava/lang/StringBuilder;-><init>()V

    invoke-virtual {v0}, Lcom/jecelyin/editor/v2/common/e;->c()Z

    move-result v4

    if-eqz v4, :cond_1

    const-string v4, "* "

    goto :goto_1

    :cond_1
    const-string v4, ""

    :goto_1
    invoke-virtual {v3, v4}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    invoke-virtual {v0}, Lcom/jecelyin/editor/v2/common/e;->b()Ljava/lang/String;

    move-result-object v4

    invoke-virtual {v3, v4}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    invoke-virtual {v3}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v3

    invoke-virtual {v1, v3}, Landroid/widget/TextView;->setText(Ljava/lang/CharSequence;)V

    .line 13
    invoke-virtual {v0}, Lcom/jecelyin/editor/v2/common/e;->a()Ljava/lang/String;

    move-result-object v1

    const/16 v3, 0xf

    if-eqz v1, :cond_3

    invoke-virtual {v0}, Lcom/jecelyin/editor/v2/common/e;->a()Ljava/lang/String;

    move-result-object v1

    invoke-static {v1}, Lcom/jecelyin/common/utils/d;->a(Ljava/lang/String;)Z

    move-result v1

    if-eqz v1, :cond_2

    goto :goto_2

    .line 14
    :cond_2
    iget-object v1, p1, Lcom/jecelyin/editor/v2/adapter/TabAdapter$a;->a:Landroid/widget/TextView;

    .line 15
    invoke-virtual {v1}, Landroid/widget/TextView;->getLayoutParams()Landroid/view/ViewGroup$LayoutParams;

    move-result-object v1

    check-cast v1, Landroid/widget/RelativeLayout$LayoutParams;

    .line 16
    invoke-virtual {v1, v3}, Landroid/widget/RelativeLayout$LayoutParams;->removeRule(I)V

    .line 17
    iget-object v3, p1, Lcom/jecelyin/editor/v2/adapter/TabAdapter$a;->a:Landroid/widget/TextView;

    invoke-virtual {v3, v1}, Landroid/widget/TextView;->setLayoutParams(Landroid/view/ViewGroup$LayoutParams;)V

    .line 18
    iget-object v1, p1, Lcom/jecelyin/editor/v2/adapter/TabAdapter$a;->b:Landroid/widget/TextView;

    invoke-virtual {v1, v2}, Landroid/widget/TextView;->setVisibility(I)V

    .line 19
    iget-object v1, p1, Lcom/jecelyin/editor/v2/adapter/TabAdapter$a;->b:Landroid/widget/TextView;

    invoke-virtual {v0}, Lcom/jecelyin/editor/v2/common/e;->a()Ljava/lang/String;

    move-result-object v0

    invoke-virtual {v1, v0}, Landroid/widget/TextView;->setText(Ljava/lang/CharSequence;)V

    goto :goto_3

    .line 20
    :cond_3
    :goto_2
    iget-object v0, p1, Lcom/jecelyin/editor/v2/adapter/TabAdapter$a;->b:Landroid/widget/TextView;

    const/16 v1, 0x8

    invoke-virtual {v0, v1}, Landroid/widget/TextView;->setVisibility(I)V

    .line 21
    iget-object v0, p1, Lcom/jecelyin/editor/v2/adapter/TabAdapter$a;->a:Landroid/widget/TextView;

    .line 22
    invoke-virtual {v0}, Landroid/widget/TextView;->getLayoutParams()Landroid/view/ViewGroup$LayoutParams;

    move-result-object v0

    check-cast v0, Landroid/widget/RelativeLayout$LayoutParams;

    .line 23
    invoke-virtual {v0, v3}, Landroid/widget/RelativeLayout$LayoutParams;->addRule(I)V

    .line 24
    iget-object v1, p1, Lcom/jecelyin/editor/v2/adapter/TabAdapter$a;->a:Landroid/widget/TextView;

    invoke-virtual {v1, v0}, Landroid/widget/TextView;->setLayoutParams(Landroid/view/ViewGroup$LayoutParams;)V

    .line 25
    :goto_3
    iget-object v0, p0, Lcom/jecelyin/editor/v2/adapter/TabAdapter;->c:Landroid/view/View$OnClickListener;

    if-eqz v0, :cond_4

    .line 26
    iget-object v0, p1, Lcom/jecelyin/editor/v2/adapter/TabAdapter$a;->c:Landroid/widget/RelativeLayout;

    invoke-static {p2}, Ljava/lang/Integer;->valueOf(I)Ljava/lang/Integer;

    move-result-object v1

    invoke-virtual {v0, v1}, Landroid/widget/RelativeLayout;->setTag(Ljava/lang/Object;)V

    .line 27
    iget-object v0, p1, Lcom/jecelyin/editor/v2/adapter/TabAdapter$a;->c:Landroid/widget/RelativeLayout;

    iget-object v1, p0, Lcom/jecelyin/editor/v2/adapter/TabAdapter;->c:Landroid/view/View$OnClickListener;

    invoke-virtual {v0, v1}, Landroid/widget/RelativeLayout;->setOnClickListener(Landroid/view/View$OnClickListener;)V

    .line 28
    iget-object v0, p1, Landroidx/recyclerview/widget/RecyclerView$ViewHolder;->itemView:Landroid/view/View;

    invoke-static {p2}, Ljava/lang/Integer;->valueOf(I)Ljava/lang/Integer;

    move-result-object p2

    invoke-virtual {v0, p2}, Landroid/view/View;->setTag(Ljava/lang/Object;)V

    .line 29
    iget-object p1, p1, Landroidx/recyclerview/widget/RecyclerView$ViewHolder;->itemView:Landroid/view/View;

    iget-object p2, p0, Lcom/jecelyin/editor/v2/adapter/TabAdapter;->c:Landroid/view/View$OnClickListener;

    invoke-virtual {p1, p2}, Landroid/view/View;->setOnClickListener(Landroid/view/View$OnClickListener;)V

    :cond_4
    return-void
.end method

.method public onCreateViewHolder(Landroid/view/ViewGroup;I)Landroidx/recyclerview/widget/RecyclerView$ViewHolder;
    .locals 3

    .line 1
    new-instance p2, Lcom/jecelyin/editor/v2/adapter/TabAdapter$a;

    invoke-virtual {p1}, Landroid/view/ViewGroup;->getContext()Landroid/content/Context;

    move-result-object v0

    invoke-static {v0}, Landroid/view/LayoutInflater;->from(Landroid/content/Context;)Landroid/view/LayoutInflater;

    move-result-object v0

    sget v1, Lcom/jecelyin/editor/v2/k;->je_tab_item:I

    const/4 v2, 0x0

    invoke-virtual {v0, v1, p1, v2}, Landroid/view/LayoutInflater;->inflate(ILandroid/view/ViewGroup;Z)Landroid/view/View;

    move-result-object p1

    invoke-direct {p2, p0, p1}, Lcom/jecelyin/editor/v2/adapter/TabAdapter$a;-><init>(Lcom/jecelyin/editor/v2/adapter/TabAdapter;Landroid/view/View;)V

    return-object p2
.end method
